<?
@session_start();
$teach_id       =$_POST['teach_id'];
$teach_name     =$_POST['teach_name'];
$teach_surname  =$_POST['teach_surname'];
$teach_address  =$_POST['teach_address'];
$teach_phone    =$_POST['teach_phone'];
$teach_email    =$_POST['teach_email'];
$picname        =$_FILES['teach_pic']['name'];
$tmp            =$_FILES['teach_pic']['tmp_name'];
$level_id       =$_POST['level_id'];

if(empty($teach_id) && empty($teach_name))
{
    echo"<meta http-equiv='refresh' content='0;URL=../login/no_loginteach.php'>";
}
else
{
    list($day,$month,$year) = explode("/",$teach_name);
    $date_check = $year."-".$month."-".$day;
    require_once('../inc/config.inc.php');
    $sql="select teach_id,teach_name,teach_surname from teacher where teach_id = '".$teach_id."' and teach_birth = '".$date_check."'";
    $table = mysql_query($sql) or die(mysql_error());
    $num = mysql_num_rows($table);
    $row=mysql_fetch_array($table);
    if($num>0)
    {
        $_SESSION['teach_id']=$row['teach_id'];
        $_SESSION['teach_name']=$row['teach_name'];
        $_SESSION['teach_surname']=$row['teach_surname'];
        echo"<meta http-equiv='refresh' content='0;URL=../admin/informationteach.php'>";
    }
    else {
        //$row = mysql_fetch_array($table);
        //if($teach_id!=$row['teach_id'] and $teach_name!=$row['teach_name'])
        echo"<meta http-equiv='refresh' content='0;URL=../login/no_loginteach.php'>";
    }
}

?>